//
//  ImageService.h
//  SaleHelper  图片处理类，用于将图片缩放、UIView转换为UIImage、压缩图片
//
//  Created by liusanchun on 12/17/13.
//  Copyright (c) 2013 liusanchun. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ImageService : NSObject

/**
 *  缩放图像到指定大小
 *
 *  @param image     图片
 *  @param scaleSize 尺寸大小
 *
 *  @return 图像
 */
+ (UIImage*)scaleImage:(UIImage*)image
               toScale:(float)scaleSize;

/**
 *  将图片转为自定义大小
 *
 *  @param image 图片
 *  @param size  尺寸
 *
 *  @return 图片
 */
+ (UIImage*)resizeImage:(UIImage*)image
                 toSize:(CGSize)size;
+(CGSize)getImageSizeWithURL:(id)imageURL;

+(UIImage *) imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth;
+ (UIImage*)compressedImages:(UIImage*)image scaleSize:(CGSize)size;

/**
 *  将UIView转换为图片
 *
 *  @param view UIView对象
 *
 *  @return 图片
 */
+ (UIImage*)convertToImage:(UIView*)view;

/**
 *  将图片压缩
 *
 *  @param image 图片
 *  @param size  尺寸
 *
 *  @return 图片
 */
+ (UIImage*)compressedImage:(UIImage*)image scaleSize:(CGSize)size;

//改变图片颜色
+ (UIImage *)imageWithColor:(UIColor *)color img:(UIImage*)image;

@end
